/* Moderne design med gradient og animasjonar */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700;800&display=swap');

:root { 
  /* Light mode colors */
  --bg-gradient-start: #667eea;
  --bg-gradient-end: #764ba2;
  --bg-light: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.95);
  --ink: #1a202c;
  --ink-light: #4a5568;
  --muted: #718096;
  --accent: #667eea;
  --accent-hover: #5a67d8;
  --success: #48bb78;
  --danger: #f56565;
  --warning: #ed8936;
  --shadow: rgba(0, 0, 0, 0.1);
  --shadow-lg: rgba(0, 0, 0, 0.15);
  --border: rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] {
  --bg-gradient-start: #1a202c;
  --bg-gradient-end: #2d3748;
  --bg-light: #2d3748;
  --bg-card: rgba(45, 55, 72, 0.95);
  --ink: #f7fafc;
  --ink-light: #e2e8f0;
  --muted: #a0aec0;
  --accent: #667eea;
  --accent-hover: #5a67d8;
  --success: #48bb78;
  --danger: #f56565;
  --warning: #ed8936;
  --shadow: rgba(0, 0, 0, 0.3);
  --shadow-lg: rgba(0, 0, 0, 0.5);
  --border: rgba(255, 255, 255, 0.1);
}

* { 
  box-sizing: border-box; 
  margin: 0;
  padding: 0;
}

body { 
  margin: 0; 
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink); 
  background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
  min-height: 100vh;
  transition: background 0.3s ease;
}
.wrap { 
  max-width: 1000px; 
  margin: 0 auto; 
  padding: 40px 20px; 
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.game-title {
  font-size: 48px;
  font-weight: 800;
  color: var(--bg-light);
  margin: 0 0 12px 0;
  text-align: center;
  text-shadow: 2px 4px 8px rgba(0, 0, 0, 0.2);
  letter-spacing: -1px;
  animation: slideDown 0.5s ease-out;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-30px); }
  to { opacity: 1; transform: translateY(0); }
}


@media (max-width: 768px) {
  .wrap { 
    padding: 20px 12px; 
  }
  
  .header-section {
    margin-bottom: 20px;
  }
  
  .game-title {
    font-size: 36px;
  }
  
  .stats-cards {
    gap: 12px;
    margin-top: 20px;
  }
  
  .stat-card {
    padding: 16px;
  }
  
  .stat-value {
    font-size: 28px;
  }
  
  .theme-toggle {
    position: static;
    margin: 16px auto 0;
    display: block;
  }
  
  .panel {
    padding: 20px;
  }
  
  .instructions { 
    padding: 16px; 
  }
  
  .instructions h3 { 
    font-size: 18px; 
  }
  
  .color-legend { 
    grid-template-columns: 1fr; 
  }
}

@media (max-width: 480px) {
  .wrap {
    padding: 16px 8px;
  }
  
  .game-title {
    font-size: 28px;
  }
  
  .stats-cards {
    gap: 8px;
    margin-top: 16px;
    margin-bottom: 0;
  }
  
  .stat-card {
    padding: 12px;
  }
  
  .stat-value {
    font-size: 24px;
  }
  
  .stat-label {
    font-size: 12px;
  }
  
  #game {
    max-height: 60vh;
    border-radius: 16px;
  }
  
  .panel {
    padding: 16px;
  }
  
  .row { 
    flex-direction: column; 
    align-items: stretch; 
    gap: 12px;
    margin-bottom: 16px;
  }
  
  .game-controls { 
    width: 100%;
    flex-direction: column;
  }
  
  .game-controls select,
  .game-controls button {
    width: 100%;
  }
  
  .instructions { 
    padding: 12px; 
  }
  
  .instructions h3 {
    font-size: 16px;
  }
  
  .instructions ul { 
    padding-left: 20px; 
  }
  
  .instructions li {
    font-size: 14px;
  }
}
#game { 
  width: 100%; 
  max-width: 450px; 
  height: 80vh; 
  max-height: 800px; 
  display: block; 
  border: none;
  background: #dff3e0; 
  border-radius: 20px;
  box-shadow: 
    0 20px 60px rgba(0, 0, 0, 0.3),
    0 0 0 1px rgba(255, 255, 255, 0.1) inset;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  animation: scaleIn 0.5s ease-out 0.2s both;
}

#game:hover {
  transform: translateY(-2px);
  box-shadow: 
    0 25px 70px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(255, 255, 255, 0.1) inset;
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}
.panel { 
  margin-top: 24px; 
  width: 100%;
  max-width: 450px;
  background: var(--bg-card);
  padding: 24px;
  border-radius: 16px;
  box-shadow: 0 10px 30px var(--shadow);
  backdrop-filter: blur(10px);
  animation: slideUp 0.5s ease-out 0.3s both;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.row { 
  display: flex; 
  gap: 16px; 
  align-items: center; 
  justify-content: space-between; 
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.score-display {
  font-size: 24px;
  font-weight: 700;
  color: var(--ink);
}

.score-display strong {
  color: var(--accent);
  font-size: 32px;
}

.game-controls { 
  display: flex; 
  gap: 12px; 
  align-items: center; 
  flex-wrap: wrap; 
}

#startBtn { 
  padding: 12px 24px; 
  border: none;
  background: var(--accent);
  color: white;
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  border-radius: 10px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

#startBtn:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

#startBtn:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

select { 
  padding: 10px 16px; 
  border: 2px solid var(--border);
  background: var(--bg-light);
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: 'Inter', sans-serif;
}

select:hover {
  border-color: var(--accent);
}

select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}
.instructions {
  margin-top: 20px;
  padding: 20px;
  background: var(--bg-card);
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: 0 4px 12px var(--shadow);
}

.instructions h3 {
  margin: 0 0 16px 0;
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
}

.instructions ul {
  margin: 0 0 20px 0;
  padding-left: 24px;
  list-style: none;
}

.instructions li {
  margin: 10px 0;
  color: var(--ink-light);
  position: relative;
  padding-left: 8px;
}

.instructions li:before {
  content: "•";
  color: var(--accent);
  font-weight: bold;
  font-size: 20px;
  position: absolute;
  left: -20px;
}

.color-legend {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--ink-light);
  padding: 8px;
  background: var(--bg-light);
  border-radius: 8px;
  transition: transform 0.2s ease;
}

.legend-item:hover {
  transform: translateX(4px);
}

.color-box {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  flex-shrink: 0;
}

.color-box.noun { background: #0a742e; }
.color-box.verb { background: #0066cc; }
.color-box.adj { background: #ff6600; }
.color-box.other { background: #333; }

/* Header section */
.header-section {
  position: relative;
  width: 100%;
  text-align: center;
  margin-bottom: 30px;
}

.theme-toggle {
  position: absolute;
  top: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.3);
  padding: 12px 16px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 24px;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.theme-toggle:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: rotate(15deg) scale(1.1);
}

.theme-icon {
  display: block;
}

/* Stats cards */
.stats-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  width: 100%;
  max-width: 450px;
  margin-top: 24px;
  margin-bottom: 0;
}

.stat-card {
  background: var(--bg-card);
  padding: 20px;
  border-radius: 16px;
  text-align: center;
  box-shadow: 0 8px 24px var(--shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  backdrop-filter: blur(10px);
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px var(--shadow-lg);
}

.stat-label {
  font-size: 14px;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.stat-value {
  font-size: 36px;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
}

/* Game stats */
.game-stats {
  margin-top: 20px;
  padding: 16px;
  background: var(--bg-light);
  border-radius: 12px;
  border: 2px solid var(--border);
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.mini-stat {
  text-align: center;
}

.mini-stat-label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.mini-stat-value {
  display: block;
  font-size: 24px;
  font-weight: 700;
  color: var(--ink);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .game-title {
    font-size: 36px;
  }
  
  .stats-cards {
    gap: 12px;
  }
  
  .stat-card {
    padding: 16px;
  }
  
  .stat-value {
    font-size: 28px;
  }
  
  .theme-toggle {
    position: static;
    margin: 16px auto 0;
    display: block;
  }
}

@media (max-width: 480px) {
  .game-title {
    font-size: 28px;
  }
  
  .game-subtitle {
    font-size: 14px;
  }
  
  #game {
    max-height: 60vh;
  }
}

/* Skjermlesarklasse */
.sr-only { position:absolute; left:-10000px; top:auto; width:1px; height:1px; overflow:hidden; }
